// by Xeno
private ["_vehicle"];
#include "x_setup.sqf"
#include "x_macros.sqf"

#define __Poss _poss = x_sm_pos select 0;
#define __PossAndOther _poss = x_sm_pos select 0;_pos_other = x_sm_pos select 1;

x_sm_pos = [[1542.9235,1603.9392,0], [1552.7311,1567.5415,0]]; // index: 18,   Government member visit in Berezino shipyard
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	d_current_mission_text = "A high enemy government member visits Camara Port today. He wants to take a look at the local ship production . Eliminate him !";
	d_current_mission_resolved_text = "The government member is dead. Good job.";
};

if (isServer) then {
	__PossAndOther
	["brdm", 2, "bmp", 2, "uaz_mg", 1, _pos_other,1,120,true] spawn XCreateArmor;
	sleep 2.123;
	["specops", 2, "basic", 1, _poss,100,true] spawn XCreateInf;
	sleep 2.111;
	_fortress = "Land_Fort_Watchtower" createVehicle _poss;
	//_fortress setDir -133.325;
	__AddToExtraVec(_fortress)
	sleep 2.123;
	__GetEGrp(_newgroup)
	_officer = switch (d_enemy_side) do {
		case "EAST": {"RU_Commander"};
		case "WEST": {"USMC_Soldier_Officer"};
		case "GUER": {"GUE_Commander"};
	};
	_sm_vehicle = _newgroup createUnit [_officer, _poss, [], 0, "FORM"];
	[_sm_vehicle] join _newgroup;
	allunits_add set [count allunits_add, _sm_vehicle];
	#ifndef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetNormal}];
	#endif
	#ifdef __TT__
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTargetTT}];
	#endif
	sleep 2.123;
	_bpos = position _fortress;
	_sm_vehicle setPos _bpos;
	_leader = leader _newgroup;
	_leader setRank "COLONEL";
	_newgroup allowFleeing 0;
	_newgroup setbehaviour "AWARE";
	_leader disableAI "MOVE";
	//_leader setUnitPos "DOWN";
};

if (true) exitWith {};